﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ProjectList.aspx.cs" Inherits="PMS.Web.ProjectList" %>

<asp:Content ID="HeadContent" ContentPlaceHolderID="HeadContent" runat="server">
    <link rel="stylesheet" href="tipswindown/tipswindown.css" type="text/css" media="all" />
    <script type="text/javascript" src="tipswindown/tipswindown.js"></script>
    <script type="text/javascript">
        function editProject(id) {
            var roleID = $("#hid_RoleID").val();
            var title = "新建项目";
            if (id != 0) {
                title = "编辑项目";
            }
            tipsWindown(title, "iframe:AddProject.aspx?roleID=" + roleID + "&id=" + id, "700", "400", "true", "", "true", "leotheme");
        }

        //删除项目
        function deleteProject(id) {
            if (confirm('确定删除?')) {
                $.post("ProjectMaintian.ashx", { action: "DeleteProject", projectID: id }, function (data) {
                    if (data == "0") {
                        Search();
                    }
                    else {
                        alert("删除失败");
                    }
                });
            }
        }

        //详细
        function desProject(id) {
            var roleID = $("#hid_RoleID").val();
            tipsWindown("项目详细", "iframe:AddProject.aspx?roleID=" + roleID + "&id=" + id + "&t=1", "700", "400", "true", "", "true", "leotheme");
        }
        //项目进展
        function desProjectEvelve(id) {
            tipsWindown("项目进展", "iframe:Evelve.aspx?projectID=" + id, "830", "480", "true", "", "true", "leotheme");
        }

        //维护保养
        function desProjectMaintain(id) {
            tipsWindown("维护保养", "iframe:Maintain.aspx?projectID=" + id, "900", "480", "true", "", "true", "leotheme");
        }

        //维修更换
        function desProjectRenewal(id) {
            tipsWindown("维修更换", "iframe:Renewal.aspx?projectID=" + id, "900", "480", "true", "", "true", "leotheme");
        }

        //财务状态
        function desProjectState(id) {
            tipsWindown("财务状态", "iframe:FinanceState.aspx?projectID=" + id, "900", "480", "true", "", "true", "leotheme");
        }

        function closeWin() {
            $("#windown-close").click();
            var roleID = $("#hid_parentID").val();
            LoadProjectList(roleID);
        }

        function GetList(roleID) {
            $("#hid_parentID").val(roleID);
            LoadProjectList(roleID);
        }

        //查询
        function Search() {
            var roleID = $("#hid_parentID").val();
            LoadProjectList(roleID);
        }

        function LoadProjectList(roleID) {
            try {
                var userID = $("#hid_UserID").val();
                var projectID = $("#MainContent_txt_ProjectID").val();
                var jdeID = $("#MainContent_txt_JDEID").val();
                var startDate = $("#txt_FromDate").val();
                var endDate = $("#txt_ToDate").val();

                //alert(roleID+"|"+userID+"|"+projectID+"|"+jdeID+"|"+startDate+"|"+endDate);
                $.post("ProjectMaintian.ashx", { action: "GetProjectList", roleID: roleID, userID: userID, projectID: projectID, jdeID: jdeID, startDate: startDate, endDate: endDate }, function (data) {
                    $("#projectMaintain").html(data);
                });
            }
            catch (ex) { }
        }
    </script>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <input type="hidden" id="hid_parentID" value="0" />
    <table width="100%">
        <tr style="padding-top: 2px">
            <td align="right" style="padding-right: 4px;">
                <asp:Label ID="Label1" runat="server" Text="项目类型"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="txt" runat="server" OnSelectedIndexChanged="txt_SelectedIndexChanged">
                    <asp:ListItem>工程项目</asp:ListItem>
                    <asp:ListItem>维保项目</asp:ListItem>
                    <asp:ListItem>维修项目</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td align="right" style="padding-right: 4px;">
                <asp:Label ID="Status" runat="server" Text="工程编号"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txt_ProjectID" runat="server" MaxLength="50"></asp:TextBox>
            </td>
            <td align="right" style="padding-right: 4px;">
                <asp:Label ID="Label5" runat="server" Text="JDE 号"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txt_JDEID" runat="server" MaxLength="50"></asp:TextBox>
            </td>
            <td align="right" style="padding-right: 4px">
                <asp:Label ID="CalendarFrom" runat="server" Text="From"></asp:Label>
            </td>
            <td>
                <input id="txt_FromDate" type="text" class="Wdate" onfocus="WdatePicker()" />
            </td>
            <td align="right" style="padding-right: 4px">
                <asp:Label ID="CalendarTo" runat="server" Text="To"></asp:Label>
            </td>
            <td>
                <input id="txt_ToDate" type="text" class="Wdate" onfocus="WdatePicker()" />
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <img src="image/mainpage_line.jpg" />
            </td>
        </tr>
        <tr>
            <td align="left" style="height: 40px">
                <input type="button" id="btn_Search" value="查询" class="BlueButton_Min" onclick="Search();" />
            </td>
            <td colspan="8">
                <asp:Button ID="btn_Add" runat="server" Text="添加" Visible="false" class="BlueButton_Min"
                    OnClientClick="editProject(0);return false;" />
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <img src="image/mainpage_line.jpg" />
            </td>
        </tr>
        <tr>
            <td colspan="8" id="projectMaintain">
            </td>
        </tr>
    </table>
</asp:Content>
